<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="ThreadManager,ender.managers.ThreadManager,NO_RUN_IMPLEMENTATION_SIG,YIELD_SIG,_debugCallCount,_debugMode,_instance,_isTicking,_lastTime,_threadSchedules,debugMode,maximumPriority,addThread,getCallCount,getInstance,onThreadTick,removeThread,restartTimer,startTimer,stopTimer" name="keywords">
<title>ender.managers.ThreadManager</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'ThreadManager - API Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?ender/managers/ThreadManager.html&amp;ender/managers/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;ThreadManager</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#constantSummary">Constants</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class ThreadManager"); titleBar_setSubNav(true,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">ender.managers</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class ThreadManager</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">ThreadManager <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p>
  The ThreadManager organizes and arranges for threads to process during execution.
  The Thread subclasses register and unregister themselves with the ThreadManager in order
  to schedule themselves for execution.
  
  Only Thread subclasses should use this class, otherwise, it should be considered
  off-limits to client code.
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#debugMode">debugMode</a> : Boolean<div class="summaryTableDescription">
   When debug mode is true, we count thread executions for testing purposes.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
</table>
</div>
<a name="protectedPropertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Properties</div>
<table id="summaryTableProtectedProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#_debugCallCount">_debugCallCount</a> : Object<div class="summaryTableDescription"> When debug mode is true, this maintains thread execution counts.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#_debugMode">_debugMode</a> : Boolean = false<div class="summaryTableDescription"> When debug mode is true, we count thread executions for testing purposes.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#_instance">_instance</a> : <a href="../managers/ThreadManager.html">ThreadManager</a> = null<div class="summaryTableDescription">[static] Singleton.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#_isTicking">_isTicking</a> : Boolean = false<div class="summaryTableDescription"> Event ticker running.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#_lastTime">_lastTime</a> : uint<div class="summaryTableDescription"> Last tick time.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#maximumPriority">maximumPriority</a> : int<div class="summaryTableDescription">[read-only]
   Returns the maximum priority so we know how often to fire the timer.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#_threadSchedules">_threadSchedules</a> : Object<div class="summaryTableDescription"> The thread schedules ready for execution.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addThread()">addThread</a>(thread:<a href="../threads/Thread.html">Thread</a>):void</div>
<div class="summaryTableDescription">
   Adds a thread to the execution schedule.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getCallCount()">getCallCount</a>(thread:<a href="../threads/IRunnable.html">IRunnable</a>):int</div>
<div class="summaryTableDescription">
   When in debug mode, gets the count of how often a thread has been executed.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getInstance()">getInstance</a>():<a href="../managers/ThreadManager.html">ThreadManager</a>
</div>
<div class="summaryTableDescription">[static]
   Singleton.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeThread()">removeThread</a>(thread:<a href="../threads/Thread.html">Thread</a>):void</div>
<div class="summaryTableDescription">
   Removes a thread from the execution schedule.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<table id="summaryTableProtectedMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#onThreadTick()">onThreadTick</a>(event:Event):void</div>
<div class="summaryTableDescription">
   Event handler for the thread ticker.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#restartTimer()">restartTimer</a>():void</div>
<div class="summaryTableDescription">
   Restarts the timer for execution.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#startTimer()">startTimer</a>():void</div>
<div class="summaryTableDescription">
   Starts the timer for execution.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#stopTimer()">stopTimer</a>():void</div>
<div class="summaryTableDescription">
   Stops the timer for execution.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
</table>
</div>
<a name="constantSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Constants</div>
<table id="summaryTableConstant" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Constant</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#NO_RUN_IMPLEMENTATION_SIG">NO_RUN_IMPLEMENTATION_SIG</a> : String = "NO_RUN"<div class="summaryTableDescription">[static] The exception signal when IRunnable.run() is not implemented.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#YIELD_SIG">YIELD_SIG</a> : String = "YLD"<div class="summaryTableDescription">[static] The exception signal for yielding.</div>
</td><td class="summaryTableOwnerCol">ThreadManager</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="_debugCallCount"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">_debugCallCount</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>protected var _debugCallCount:Object</code><p> When debug mode is true, this maintains thread execution counts.  Testing only. </p></div>
<a name="_debugMode"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">_debugMode</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var _debugMode:Boolean = false</code><p> When debug mode is true, we count thread executions for testing purposes. </p></div>
<a name="debugMode"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">debugMode</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>debugMode:Boolean</code>&nbsp;&nbsp;[read-write]<p>
   When debug mode is true, we count thread executions for testing purposes.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get debugMode():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set debugMode(value:Boolean):void</code>
<br>
</div>
<a name="_instance"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">_instance</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected static var _instance:<a href="../managers/ThreadManager.html">ThreadManager</a> = null</code><p> Singleton. </p></div>
<a name="_isTicking"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">_isTicking</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var _isTicking:Boolean = false</code><p> Event ticker running. </p></div>
<a name="_lastTime"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">_lastTime</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var _lastTime:uint</code><p> Last tick time. </p></div>
<a name="maximumPriority"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">maximumPriority</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>maximumPriority:int</code>&nbsp;&nbsp;[read-only]<p>
   Returns the maximum priority so we know how often to fire the timer.
   
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;protected function get maximumPriority():int</code>
<br>
</div>
<a name="_threadSchedules"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">_threadSchedules</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var _threadSchedules:Object</code><p> The thread schedules ready for execution. </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addThread()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addThread</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addThread(thread:<a href="../threads/Thread.html">Thread</a>):void</code><p>
   Adds a thread to the execution schedule.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">thread</span>:<a href="../threads/Thread.html">Thread</a></code> &mdash; The thread to add to the execution schedule.
   </td>
</tr>
</table>
</div>
<a name="getCallCount()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getCallCount</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getCallCount(thread:<a href="../threads/IRunnable.html">IRunnable</a>):int</code><p>
   When in debug mode, gets the count of how often a thread has been executed.
   Useful for testing purposes only.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">thread</span>:<a href="../threads/IRunnable.html">IRunnable</a></code> &mdash; The thread to check execution count for.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>int</code> &mdash; Returns the number of times the thread has been executed.
   </td>
</tr>
</table>
</div>
<a name="getInstance()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getInstance</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getInstance():<a href="../managers/ThreadManager.html">ThreadManager</a></code><p>
   Singleton.
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../managers/ThreadManager.html">ThreadManager</a></code></td>
</tr>
</table>
</div>
<a name="onThreadTick()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">onThreadTick</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function onThreadTick(event:Event):void</code><p>
   Event handler for the thread ticker.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">event</span>:Event</code></td>
</tr>
</table>
</div>
<a name="removeThread()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeThread</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeThread(thread:<a href="../threads/Thread.html">Thread</a>):void</code><p>
   Removes a thread from the execution schedule.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">thread</span>:<a href="../threads/Thread.html">Thread</a></code> &mdash; The thread to remove from the execution schedule.
   </td>
</tr>
</table>
</div>
<a name="restartTimer()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">restartTimer</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function restartTimer():void</code><p>
   Restarts the timer for execution.
   </p></div>
<a name="startTimer()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">startTimer</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function startTimer():void</code><p>
   Starts the timer for execution.
   </p></div>
<a name="stopTimer()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">stopTimer</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function stopTimer():void</code><p>
   Stops the timer for execution.
   </p></div>
<a name="constantDetail"></a>
<div class="detailSectionHeader">Constant detail</div>
<a name="NO_RUN_IMPLEMENTATION_SIG"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">NO_RUN_IMPLEMENTATION_SIG</td><td class="detailHeaderType">constant</td>
</tr>
</table>
<div class="detailBody">
<code>public static const NO_RUN_IMPLEMENTATION_SIG:String = "NO_RUN"</code><p> The exception signal when IRunnable.run() is not implemented. </p></div>
<a name="YIELD_SIG"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">YIELD_SIG</td><td class="detailHeaderType">constant</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static const YIELD_SIG:String = "YLD"</code><p> The exception signal for yielding. </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
